package fr.upmc.aladyn.transactionables.tests.application;

import fr.upmc.aladyn.transactionables.annotations.Transactionable;

/**
 * <p>Test class</p>
 * @author Alexis Deluze
 *
 */

@Transactionable
public abstract class Personne {

	private int age;
	private String nom;
	private EtatCivil etatCivil;

	public Personne(String nom, int age){
		this.nom = nom;
		this.age = age;
		this.etatCivil = EtatCivil.Celibataire;
	}
	


	public abstract void print();
	
	@Transactionable
	public void anniversaire(){
		System.out.println("\n#--------------------------");
		System.out.println("C'est l'anniversaire de "+nom+", age : "+(age+1)+" ans.");
		System.out.println("#--------------------------\n");
		setAge(age + 1);
	}
	
	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public EtatCivil getEtatCivil() {
		return etatCivil;
	}

	public void setEtatCivil(EtatCivil etatCivil) {
		this.etatCivil = etatCivil;
	}
}
